package com.softserveinc.controller;

/**
 * Controller for admin mapping for "/home" and "/info" URLs
 */

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("admin")

public class AdminController {
    /**
     *
     * @param model - includes attribute for jsp
     * @return - home.jsp
     */
    @RequestMapping(value = "/home", method = RequestMethod.GET)
    public String homePage(ModelMap model) {


        model.addAttribute("message", "Admin home page");
        return "home";

    }

    /**
     *
     * @param model - includes attributes for jsp
     * @return - info.jsp
     */
    @RequestMapping(value = "/info", method = RequestMethod.GET)
    public String infoPage(ModelMap model) {
        model.addAttribute("imessage", "Admin info page");
        return "info";

    }
}
